<%@ include file="/WEB-INF/views/common/includes.jsp"%>
<head>
<script type="text/javascript">
	function addOpt() {
		var how = document.getElementById("how");
		var selectedHow = how.options[how.selectedIndex].text;
		var much = document.getElementById("much");
		var selectedMuch = much.options[much.selectedIndex].text;
		var ingredient = document.getElementById("ingredient");
		var selectedIngredient = ingredient.options[ingredient.selectedIndex].text;
		var style = document.getElementById("style");
		var selectedStyle = style.options[style.selectedIndex].text;

		var newIngredient = selectedHow + "/" + selectedMuch + "/"
				+ selectedIngredient + "/" + selectedStyle;

		var select = document.getElementById("myselect");
		select.options[select.options.length] = new Option(newIngredient);
	    
	}
	
//delete from the selectbox 
	function removeItem(selectbox)
	{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
	if(selectbox.options[i].selected)
	selectbox.remove(i);
	}
	}

	function selectAllOptions(id) {
		var ref = document.getElementById(id);
		
		for (i = 0; i < ref.options.length; i++)
			ref.options[i].selected = true;
	}
	
	function isNumberKey(evt){
	    var charCode = (evt.which) ? evt.which : evt.keyCode
	    return !(charCode > 31 && (charCode < 48 || charCode > 57));
	}

</script>
</head>
<body>
	<c:if test="${not empty param.success}">
		<div class="alert alert-success">
			<button type="button" class="close" data-dismiss="alert">
				<i class="icon-remove"></i>
			</button>
			<i class="icon-ok-sign"></i> You successfully added a <strong>menu!</strong>
		</div>
	</c:if>
	
	<c:forEach var="mymenu" items="${menuList}">
		Menu: ${mymenu.name}
		<br>
		<br>
		<c:forEach var="recipe" items="${recipesOf}"> 
			Recipe: ${recipe.recipe_name}<br>
		</c:forEach>
		<br>
	</c:forEach>	
	
	
	<br>
</body>
